package com.sardine.base.hbase.executor;

import com.sardine.base.hbase.persister.HEntity;

import java.util.List;

/**
 * 上海京东到家元信信息技术有限公司<br>
 * Created with IntelliJ IDEA.
 * Date:2017/11/22
 * Time:16:36
 * hbase 持久化类
 * @author daifeng<br>
 *         daifeng@imdada.cn
 * @since JDK 1.7 <br>
 * Copyright (c) 2017 imdada System Incorporated All Rights Reserved.
 */
public interface HBaseRepository {
    /**
     * 保存一个实体
     * @param hEntity
     * @return
     */
    void save(HEntity hEntity);

    /**
     * 同步批量插入
     * @param hEntities
     */
    void save(List<HEntity> hEntities);

    /**
     * 异步批量插入
     * @param hEntities
     */
    void saveAsync(List<HEntity> hEntities);

    /**
     * 根据rowKey 查询一个值
     * @param hEntity
     * @return
     */
    HEntity load(HEntity hEntity);

    /**
     * 批量查询一组数据
     * @param hEntity
     * @param rowKey
     * @return
     */
    List<HEntity> loadList(HEntity hEntity, List<String> rowKey);
}
